package com.aat.grab.rule.dao;

import java.io.Serializable;
import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;

public interface BaseDao<T, ID extends Serializable> {

	public <S extends T> S addOne(S entity);

	public <S extends T> List<S> addMore(Iterable<S> entities);

	public void deleteOne(T entity);

	public void deleteByID(ID id);

	public void deleteAll();
	
	public <S extends T> S updateOne(S entity);

	public T queryByID(ID id);

	public List<T> queryAll();

	public Iterable<T> queryAll(Iterable<ID> ids);

	public Page<T> queryAll(Pageable pageable);

	public List<T> queryAll(Sort sort);
	
	public long count();

	public boolean exists(ID id);
	

}
